#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"mysql/mysql.h"
int main(int argc,char* argv[])
{
    MYSQL my_connection;
    int res,i,j,first_time=1;
    char query[300];
    mysql_init(&my_connection);
    if(mysql_real_connect(&my_connection,"localhost","root","xxx",
                "database_flow",0,NULL,CLIENT_FOUND_ROWS))
    {
        printf("Connection success\n");
        sprintf(query,"call AddValue(%d,%ld,%d,%ld,%d,%d,%s)",20,111,24,222,24,6,"\"WEB\"");
        if(mysql_real_query(&my_connection,query,(unsigned int)strlen(query)))
            printf("Error exec query:%s\n",mysql_error(&my_connection));
        else
            printf("[%s] exec...\n",query);
        mysql_close(&my_connection);
    }
    else
    {
        printf("Connection failed\n");    
        if(mysql_errno(&my_connection))
            printf("Connection error %d: %s\n",mysql_errno(&my_connection),mysql_error(&my_connection));
    }
    return EXIT_SUCCESS;
}
